home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 248 / 248.d81 / t.about db < prev    next >
Text File  |  2022-08-26  |  5KB  |  170 lines

  1. u
  2.          BEHIND DOTBASIC PLUS
  3.            by Dave Moorman
  4.  
  5.  
  6.     Several years ago, my PC guru,
  7. Kevin Barrow, was taking a course in
  8. Beginning Programming at Lamar
  9. Community College. When I found out
  10. that they were learning Visual Basic
  11. and C, I conned the instructor into
  12. letting me audit the second half of
  13. the course. I wanted to learn C. She
  14. obliged, and even gave me the
  15. textbook.
  16.  
  17.     I didn't much care for C. The
  18. systax is quite different than BASIC.
  19. And linking and compiling can be a
  20. source of extreme frustration --
  21. especially when a list of Fatal Errors
  22. scrolls up the screen. With a
  23. compiler, you [must] correct fatal
  24. errors before you can find out if you
  25. made any logic errors. Which you
  26. probably have.
  27.  
  28.     One thing I did find fascinating
  29. about C was the concept of "include."
  30. You see, C is nothing but a shell. The
  31. real work is done by command
  32. libraries, which you must INCLUDE in
  33. your code. There is a nearly infinite
  34. number of such libraries. How to use
  35. one is the $64 question -- that being
  36. the price of the book. Each book. A
  37. nearly infinite number of books.
  38.  
  39.     One thing about programming the
  40. C-64: we have BASIC built in. We also
  41. have many useable ML routines built
  42. in. And thanks to LOADSTAR, I have
  43. dozens of ML modules such as Mr.Mouse
  44. that greatly extend the power of
  45. BASIC. And all of LOADSTAR's
  46. "includes" are fully documented with
  47. their publication. No extra books!
  48.  
  49.     Or, if I need some small piece of
  50. code to push around bits and bytes in
  51. a certain and fast way, I have ML
  52. itself. This is where I live quite
  53. comfortably, thank you.
  54.  
  55.     But Kevin and I got talking late
  56. one night over coffee at the 24-hour
  57. truck stop about what can and can't be
  58. done on the PC as opposed to the C-64.
  59. Assembly object code on the Intel-type
  60. processors is very relocatable. In
  61. fact, the operating system takes care
  62. of memory management for you. With the
  63. C-64 and the 65xx ML instructions, we
  64. are not so fortunate. Most 65xx
  65. instructions require Absolute
  66. Addressing -- that is, when you
  67.  
  68.  LDA ADDRESS
  69.  
  70. you must be sure ADDRESS is the right
  71. place in memory. Of course, you can
  72. use ML MOVE by Jeff Jones to relocate
  73. the code. But you still must do some
  74. memory management to know where to
  75. relocate it.
  76.  
  77.     "What you need," Kevin opined, "is
  78. a module that can be BLOADED anywhere
  79. in memory and work perfectly."
  80.  
  81.     Thanks, Kevin! We do have Relative
  82. Branch instructions that can leap low
  83. buildings in a single bound (-128 to
  84. +127 bytes). And we do have Indirect
  85. Addressing that uses Zero Page as if
  86. it consists of 128 memory registers.
  87. The Intel- type processors never had
  88. that. (OK, they DO have their way to
  89. do indirect indexed addressing, and
  90. Intel is not a [bad] processor. Heck,
  91. a 400 Mhz+ Pentium will run VICE :-)
  92.  
  93.     So I got busy and devised MARM --
  94. Moorman's Adaptable Relocatable Module
  95. system. The programmer can use MARM
  96. Maker to collect various commands into
  97. a truly relocatable module. In the
  98. program, the module's load address is
  99. SYSed, and the jump table for the
  100. various commands is placed in the
  101. cassette buffer.
  102.  
  103.     MARM was a good beginning, but
  104. suffered from lack of forethought. One
  105. routine could not call another, since
  106. the computer had no idea where that
  107. other routine might be, if it was in
  108. memory at all. And multiple routines
  109. could not safely share data. MARM just
  110. had no way to do complexity.
  111.  
  112.     Then we got on another tack --
  113. creating a Visual Basic for the C-64.
  114. It would need to have Visual Design
  115. and an Event Driven environment. That
  116. meant the programmer would design the
  117. screen first, defining Event Areas
  118. (where clicking would do something)
  119. and assigning line numbers for the
  120. Event Handling routines.
  121.  
  122.     I am proud that DotBASIC v1 did
  123. both and more, and have turned to it
  124. for a dozen projects. However, having
  125. to design a screen first is a bit of a
  126. pain (not to mention some 18 pages of
  127. memory being used for that screen).
  128. Also, the Event Driver routine could
  129. get in the way of editing the code.
  130. Besides, the limits of my Event Driver
  131. became apparent -- at least to me.
  132.  
  133.     Besides, DotBASIC v1 did not
  134. address the desire for an adaptable
  135. extension of BASIC. With adaptability,
  136. new commands could be written as
  137. needed. Old commands could be reworked
  138. ad infinitum. And, in theory, the
  139. memory overhead would only be what was
  140. really needed for a particular
  141. program.
  142.  
  143.     I needed an INCLUDE!
  144.  
  145.     The problem boiled down to how to
  146. handle the new command names. I
  147. decided to use a table called COMAD,
  148. which would be created to include all
  149. the commands used in a program, along
  150. with the memory locations of the
  151. included commands.
  152.  
  153.     The relocatable ML routines would
  154. use the same COMAD table when calling
  155. another routine or shared data. Soon I
  156. had DB+ up and working -- and here it
  157. is.
  158.  
  159.     Take a look at all the information
  160. on Side 4. Even if you are fairly new
  161. at plain old BASIC, DB+ will give you
  162. the power you need to do most anything
  163. computational -- without having to
  164. worry about memory management and
  165. other fine points. Just include the
  166. commands you want -- and away you go!
  167.  
  168.  DMM
  169.  
  170.  
  171.